package test.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public   class ChangeJsonHump {
        public static String change(String str) {
           // str = str.toLowerCase();
            final StringBuffer sb = new StringBuffer();
            Pattern p = Pattern.compile("_(\\w)");
            Matcher m = p.matcher(str);
            while (m.find()){
                m.appendReplacement(sb,m.group(1).toUpperCase());
            }
            m.appendTail(sb);
           return sb.toString();
        }

    public static void main(String[] args) {
        String a ="{\n" +
                "    \"amount\":20,\n" +
                "    \"apply_date\":\"2020-08-11 00:00:00\",\n" +
                "    \"code\":\"FYBX-202008-00034\",\n" +
                "    \"company\":\"0104\",\n" +
                "    \"department\":\"0101012\",\n" +
                "    \"entry_msg\":[\n" +
                "        {\n" +
                "            \"accompanyQuantity\":\"1\",\n" +
                "            \"admin_org\":\"0101004\",\n" +
                "            \"budget_dep\":\"0101004\",\n" +
                "            \"business_type\":\"\",\n" +
                "            \"cost_company\":\"000111\",\n" +
                "            \"cost_reason\":\"aaa\",\n" +
                "            \"cost_type\":\"\",\n" +
                "            \"entertainQuantity\":\"3\",\n" +
                "            \"handperson\":\"avcx\",\n" +
                "            \"invoiceType\":\"102\",\n" +
                "            \"isAllopatry\":\"Y\",\n" +
                "            \"notaxAmount\":8,\n" +
                "            \"occurrence_time\":\"2018-11-19 00:00:00\",\n" +
                "            \"payperiod\":\"1\",\n" +
                "            \"payperiodcount\":\"1\",\n" +
                "            \"personCount\":\"2\",\n" +
                "            \"rate\":12,\n" +
                "            \"reimbursable_amount\":20,\n" +
                "            \"standard\":\"402\",\n" +
                "            \"tax\":12\n" +
                "        }\n" +
                "    ],\n" +
                "    \"invoice_msg\":[\n" +
                "        {\n" +
                "            \"check_code\":\"4455\",\n" +
                "            \"invoiceTypeNumber\":\"102\",\n" +
                "            \"invoice_amount\":222,\n" +
                "            \"invoice_code\":\"233333333\",\n" +
                "            \"invoice_date\":\"2020-03-10 00:00:00\",\n" +
                "            \"invoice_number\":\"121\",\n" +
                "            \"invoice_tax\":11,\n" +
                "            \"invoice_tax_rate\":21,\n" +
                "            \"invoice_type\":\"102\",\n" +
                "            \"iso900\":\"None\",\n" +
                "            \"this_use_amount\":222,\n" +
                "            \"true_false\":\"\",\n" +
                "            \"use_time\":\"1\"\n" +
                "        }\n" +
                "    ],\n" +
                "    \"methodName\":\"submit\",\n" +
                "    \"oa_name\":\"123\",\n" +
                "    \"payee_msg\":[\n" +
                "        {\n" +
                "            \"amount\":210.01,\n" +
                "            \"deposit_bank\":\"开户银行测试\",\n" +
                "            \"pay_method\":\"A03\",\n" +
                "            \"payee\":\"李银娜\",\n" +
                "            \"payee_code\":\"18026200866\",\n" +
                "            \"receipt_number\":\"18026200866\"\n" +
                "        }\n" +
                "    ],\n" +
                "    \"position\":\"TYOT02\",\n" +
                "    \"reason\":\"招待费提交99\",\n" +
                "    \"saveOrSumbit\":\"1\",\n" +
                "    \"sessionId\":\"f611acaf-3a88a9\",\n" +
                "    \"submit_address\":\"03\",\n" +
                "    \"telephone\":\"11011912020\",\n" +
                "    \"uOrs\":\"1\",\n" +
                "    \"user_name\":\"TY1017\"\n" +
                "}\n";
        String change = ChangeJsonHump.change(a);
        System.out.println(change);
    }


}
